﻿@page "/docs/extensions/datagrid/features/auto-generate-columns"

<Seo Canonical="/docs/extensions/datagrid/features/auto-generate-columns" Title="Blazorise DataGrid Auto Generate Columns" Description="Learn Blazorise by the example. The DataGrid can automatically generate columns based on the TItem type." />

<DocsPageTitle Path="Extensions/DataGrid/Features/Auto Generate Columns">
    Blazorise DataGrid: Auto Generate Columns
</DocsPageTitle>

<DocsPageLead>
    The DataGrid can automatically generate columns based on the TItem type.
</DocsPageLead>

<DocsPageSubtitle>
    Overview
</DocsPageSubtitle>

<DocsPageParagraph>
    If no columns are defined, the DataGrid will automatically generate columns based on the TItem type.
</DocsPageParagraph>
<DocsPageParagraph>
    An attribute based API is provided to specify additional metadata that is used to specify how the columns will be built.
</DocsPageParagraph>
<DocsPageUnorderedList>
    <DocsPageUnorderedListItem>
        <Code>[DisplayAttribute]</Code> - Represents an attribute that can be applied to properties or fields to specify the caption.
    </DocsPageUnorderedListItem>
    <DocsPageUnorderedListItem>
        <Code>[OrderAttribute]</Code> - Represents an attribute that can be applied to properties or fields to specify the order in which they should be displayed or edited.
    </DocsPageUnorderedListItem>
    <DocsPageUnorderedListItem>
        <Code>[IgnoreFieldAttribute]</Code> - Represents an attribute that can be applied to properties or fields to specify they should not be automatically generated.
    </DocsPageUnorderedListItem>
    <DocsPageUnorderedListItem>
        <Code>[SelectAttribute]</Code> - Represents an attribute that can be applied to properties or fields to specify additional metadata for a select component.
    </DocsPageUnorderedListItem>
    <DocsPageUnorderedListItem>
        <Code>[NumericAttribute]</Code> - Represents an attribute that can be applied to numeric properties or fields to specify additional metadata.
    </DocsPageUnorderedListItem>
    <DocsPageUnorderedListItem>
        <Code>[DateAttribute]</Code> - Represents an attribute that can be applied to date properties or fields to specify additional metadata.
    </DocsPageUnorderedListItem>
</DocsPageUnorderedList>

<DocsPageSubtitle>
    Example
</DocsPageSubtitle>

<DocsPageSection>
    <DocsPageSectionContent FullWidth Outlined>
        <DataGridAutoGenerateColumnsExample />
    </DocsPageSectionContent>
    <DocsPageSectionSource Code="DataGridAutoGenerateColumnsExample" />
</DocsPageSection>

<DocsPageApi>
    <DocsPageApiItem Url="docs/extensions/datagrid/api" Name="<DataGrid />" />
</DocsPageApi>